package string;

/**
 * String和StringBuilder的性能测试
 */
public class StringAndStringBuilderDemo {
    public static void main(String[] args) {
       String str="a";
       for(int i=0;i<1000000;i++){
           str+="a";
       }
       System.out.println(str);

       StringBuilder sb=new StringBuilder("a");
       for(int i=0;i<1000000;i++) {
           sb = sb.append("a");
       }
       System.out.println(sb);
    }
}